<script setup>
import Loading from "@/components/loading.vue";
import { useIndexStore } from "@/store/main";
import { onMounted } from "vue";
import { useWindowSize } from "@vueuse/core";
import { useUserStore } from "@/store/user.js";
import { get } from "@/request";

const indexStore = useIndexStore()
const userStore = useUserStore()


onMounted(async () => {
  document.documentElement.classList.remove('dark')
  const { width } = useWindowSize()
  if (width.value < 768) {
    indexStore.isMobile = true
  }
  const inform = await get('/inform')
  userStore.set_inform(inform.data)
})
</script>

<template>
  <loading>
    <transition name="el-fade-in">
      <el-scrollbar>
        <router-view />
      </el-scrollbar>
    </transition>
  </loading>
</template>

<style>

</style>
